//AC both in poj and hoj
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;

int position[11][10];

typedef struct cPieces
{
  char cType;
  int positionX;
  int positionY;
  struct cPieces *next;
}ChessPieces;

int IsInTheChessBoard(int x,int y)
{
  if((x >= 1&&x <= 10)
     &&(y >= 1&&y <= 9))
    return 1;

  return 0;
}

int IsInThePalace(int x,int y)
{
  if((x>=1&&x<=3)
     &&(y>=4&&y<=6))
    return 1;

  return 0;
}

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)

int CheckMate(int x,int y,ChessPieces piecesArray[],int n)
{
  int result = 0;
  int bX = x;
  int bY = y;
  int i,j,k;
  int sum;
  for(i = 0;i<n;i++) 
    {
      if(piecesArray[i].cType == 'G')  
        {
          sum = 0;
          if(bY == piecesArray[i].positionY)  
            {
              for(j = bX + 1;j<piecesArray[i].positionX;j++)
                  sum += position[j][bY];
              if(sum == 0)
                return 1;
            }
        }
      else if(piecesArray[i].cType == 'R')
        {
          if(bX == piecesArray[i].positionX && bY == piecesArray[i].positionY)
              continue;

          
          if(bY == piecesArray[i].positionY )
            {
              sum = 0;              
              for(j = MIN(bX,piecesArray[i].positionX) + 1 ;j<MAX(bX,piecesArray[i].positionX) ;j++ )
                  sum += position[j][bY];
              if(sum == 0)
                  return 1;
            }
          else if(bX == piecesArray[i].positionX)    
            {
              sum = 0;
              for(j = MIN(bY,piecesArray[i].positionY) + 1 ;j<MAX(bY,piecesArray[i].positionY) ;j++ )
                sum += position[bX][j];

              if(sum == 0)
                return 1;
            }
        }
      else if(piecesArray[i].cType == 'C')  
        {
          if(bX == piecesArray[i].positionX && bY == piecesArray[i].positionY)
            continue;

          if(bY == piecesArray[i].positionY )
            {
              sum = 0;
              for(j = MIN(bX,piecesArray[i].positionX) + 1 ;j<MAX(bX,piecesArray[i].positionX) ;j++ )
                sum += position[j][bY];
              if(sum == 1) 
                return 1;
            }
          if(bX == piecesArray[i].positionX)    
            {
              sum = 0;
              for(j = MIN(bY,piecesArray[i].positionY) + 1 ;j<MAX(bY,piecesArray[i].positionY) ;j++ )
                sum += position[bX][j];
              
              if(sum == 1)
                return 1;
            }
        }
      else if(piecesArray[i].cType == 'H')
        {
          if(bX == piecesArray[i].positionX && bY == piecesArray[i].positionY)
            continue;

          if(abs(bX - piecesArray[i].positionX) == 2 && abs(bY - piecesArray[i].positionY) == 1)
            {
              if(bX>piecesArray[i].positionX)
                {
                  if(position[piecesArray[i].positionX + 1][piecesArray[i].positionY] == 0)
                    {
                      return 1;
                    }
                }
              else if(bX<piecesArray[i].positionX) 
                {
                  if(position[piecesArray[i].positionX - 1][piecesArray[i].positionY] == 0)
                    return 1;

                }
            }
          else if(abs(bX - piecesArray[i].positionX) == 1 && abs(bY - piecesArray[i].positionY) == 2)
            {
              if(bY>piecesArray[i].positionY)
                {
                  if(position[piecesArray[i].positionX][piecesArray[i].positionY + 1] == 0)
                    {
                      return 1;
                    }
                }
              else if(bY<piecesArray[i].positionY) 
                {
                  if(position[piecesArray[i].positionX][piecesArray[i].positionY - 1] == 0)
                    {
                      return 1;
                    }
                }
            }
        }
    }

  return 0;
}



int main() 
{
  int n,x,y;
  char type;
  int px,py;
  int i,j,k;
  char temp;


  int result = 0;

  ChessPieces piecesArray[7];
  
  for(i = 0;i<11;i++)
    for(j = 0;j<10;j++)
      {
        position[i][j] = 0;
      }


#ifdef FILEIO
  freopen("in.txt","r",stdin); 
  freopen("out.txt","w",stdout); 
#endif

  while(1)
    {
      //if(scanf("%d %d %d",&n,&x,&y)==EOF)
      //  break;
		cin>>n>>x>>y;
      temp=getchar();
      if(n == 0
         &&x == 0
         &&y == 0) 
        break;
      memset(piecesArray,0,7*sizeof(ChessPieces));
      for(i = 0;i<n;i++)
        {
          //          ChessPieces *cp = xmalloc();
          //scanf("%c %d %d",&(piecesArray[i].cType),&(piecesArray[i].positionX),&(piecesArray[i].positionY));
		  cin>>piecesArray[i].cType>>piecesArray[i].positionX>>piecesArray[i].positionY;
          temp=getchar();
          position[piecesArray[i].positionX][piecesArray[i].positionY] = 1;  
        }

      if(IsInThePalace(x+1,y))
        {
          if(CheckMate(x+1,y,piecesArray,n) == 1)
            result  += 1; 
        }
      else
        result += 1; 
			
      if(IsInThePalace(x-1,y))
        {
          if(CheckMate(x-1,y,piecesArray,n) == 1)
            result  += 1; 
        }
      else
        result += 1; 
			
      if(IsInThePalace(x,y+1))
        {
          if(CheckMate(x,y + 1,piecesArray,n) == 1)
            result += 1; 
        }
      else
        result += 1; 
			
      if(IsInThePalace(x,y-1))
        {
          if(CheckMate(x,y - 1,piecesArray,n) == 1)
            result += 1; 
        }
      else
        result += 1;

      if(result == 4)
        printf("YES\n");
      else
        printf("NO\n");

      result = 0;

#ifdef OUTPUT
      for(i = 0;i<11;i++)
	  {
        for(j = 0;j<10;j++)
          {
            printf("%d ",position[i][j]);
          }
		printf("\n");
	  }
#endif
      
      for(i = 0;i<11;i++)
        for(j = 0;j<10;j++)
          {
            position[i][j] = 0;
          }
      temp=getchar();
    }

#ifdef FILEIO
  fclose(stdin);
  fclose(stdout);
#endif

  return 0; 
} 